#ifndef __TEXTDLGH_G__
#define __TEXTDLGH_G__

#include "wx/defs.h"
#include "wx/dialog.h"
#include "wx/valtext.h"

class wxTextCtrl;
extern const wxChar wxGetTextFromUserPromptStr[];
extern const wxChar wxGetPasswordFromUserPromptStr[];

#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)

class wxTextEntryDialog : public wxDialog {
  public:
    wxTextEntryDialog( wxWindow *parent, const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
                       const wxString& value = wxEmptyString, long style = wxTextEntryDialogStyle,
                       const wxPoint& pos = wxDefaultPosition );

    void SetValue( const wxString& val );
    wxString GetValue() const { return m_value; }
    void SetTextValidator( const wxTextValidator& validator );
    void SetTextValidator( long style = wxFILTER_NONE );
    wxTextValidator* GetTextValidator() { return ( wxTextValidator* )m_textctrl->GetValidator(); }
    void OnOK( wxCommandEvent& event );

  protected:
    wxTextCtrl *m_textctrl;
    wxString    m_value;
    long        m_dialogStyle;

  private:
    DECLARE_EVENT_TABLE()
    DECLARE_DYNAMIC_CLASS( wxTextEntryDialog )
    DECLARE_NO_COPY_CLASS( wxTextEntryDialog )
};

class wxPasswordEntryDialog : public wxTextEntryDialog {
  public:
    wxPasswordEntryDialog( wxWindow *parent, const wxString& message, const wxString& caption = wxGetPasswordFromUserPromptStr,
                           const wxString& value = wxEmptyString, long style = wxTextEntryDialogStyle,
                           const wxPoint& pos = wxDefaultPosition );
  private:
    DECLARE_DYNAMIC_CLASS( wxPasswordEntryDialog )
    DECLARE_NO_COPY_CLASS( wxPasswordEntryDialog )
};

wxString wxGetTextFromUser( const wxString& message, const wxString& caption = wxGetTextFromUserPromptStr,
                   const wxString& default_value = wxEmptyString, wxWindow *parent = ( wxWindow * ) NULL,
                   wxCoord x = wxDefaultCoord, wxCoord y = wxDefaultCoord, bool centre = true );

wxString wxGetPasswordFromUser( const wxString& message, const wxString& caption = wxGetPasswordFromUserPromptStr,
                       const wxString& default_value = wxEmptyString, wxWindow *parent = ( wxWindow * ) NULL,
                       wxCoord x = wxDefaultCoord, wxCoord y = wxDefaultCoord, bool centre = true );

#endif
